<!-- view -->
 <template>
  <div>
    <h1>{{ msg }}</h1>
    <div>
      <p>clicked: {{ count }}</p>
      <button @click="increment">点击+</button>
      <button @click="decrement">点击-</button>
    </div>
  </div>
</template> 

<script>
export default {
  name: "Test1",
  props: {
    msg: String,
  },
  // state
  data() {
    return {
      count: 0,
    };
  },
  // actions
  methods: {
    increment() {
      this.count++;
    },
    decrement() {
      this.count--;
    },
  },
};
</script>
